from flask.blueprints import Blueprint

# from flask_restful import Api
from toutiaoapi.flaskrestful import BaseApi

# 创建蓝图
# url_prefix: 这是路有的一个前缀
user_blueprint = Blueprint("user",__name__,url_prefix="/app/v1_0")

# 创建API接管蓝图
user_api = BaseApi(user_blueprint)

# 导入views
from . import views

# 绑定路由
user_api.add_resource(views.LoginResource,"/authorizations")
user_api.add_resource(views.SmsCodeResourece,"/sms/codes/<mobile>/")

########压力测试的两个路由######
# 无缓存
user_api.add_resource(views.UserInfoResource,"/user")
# 有缓存
user_api.add_resource(views.CacheUserInfoResource,"/user/cache")

# 再到toutiao的init进行注册蓝图